package com.sz.wechat.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sz.wechat.entity.User;
import com.sz.wechat.mapper.UserMapper;
import com.sz.wechat.service.WxService;
import com.sz.wechat.utils.Md5Util;
import org.springframework.stereotype.Service;

@Service
public class WxServiceImpl extends ServiceImpl<UserMapper, User> implements WxService {

    @Override
    public String getWxInfo() {
        // 实现获取微信信息的逻辑
        return "WeChat Information";
    }

    @Override
    public User login(String username, String password) {
        String encodedPassword = Md5Util.encrypt(password);
        return baseMapper.selectByUserNameAndPassword(username, encodedPassword);
    }
}